import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 强仔
 * Date: 2022-05-22
 * Time: 15:34
 */
public class Main {
    /*
    * 组队竞赛
    * 贪心算法
    * https://www.nowcoder.com/questionTerminal/6736cc3ffd1444a4a0057dee89be789b?orderByHotValue=1&page=1&onlyReference=false
    * 本题的主要思路是贪心算法，贪心算法其实很简单，就是每次选值时都选当前能看到的局部最解忧，
    * 所以这里的贪心就是保证每组的第二个值取到能选择的最大值就可以，我们每次尽量取最大，但是最大的数不可能是中位数，所以退而求其次，取每组中第二大的
    *
    * */
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int len = n * 3;
        long[] arrays = new long[len];
        for (int i = 0; i < len; i++) {
            arrays[i] = scanner.nextInt();
        }


        Arrays.sort(arrays);
        long result = 0;
        for (int i = 0; i < n; i++) {
            result = result + arrays[len - (i + 1) * 2];
        }
        System.out.println(result);
    }


    /*
    * 删除公共的字符
    * Set
    * https://www.nowcoder.com/practice/f0db4c36573d459cae44ac90b90c6212?tpId=85&&tqId=29868&rp=1&ru=/activity/oj&qru=/ta/2017test/question-ranking
    * 
    * */
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String original = scanner.nextLine();
        String remove = scanner.next();
        HashSet<Character> set = new HashSet<>();
        for (char ch : remove.toCharArray()) {
            set.add(ch);
        }

        StringBuilder result = new StringBuilder();
        for (char ch : original.toCharArray()) {
            if(!set.contains(ch)){
                result.append(ch);
            }
        }

        System.out.println(result);
    }

}
